package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.controller.BaseController;
import com.zzyl.common.core.domain.AjaxResult;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.serve.domain.NursingProject;
import com.zzyl.serve.service.INursingProjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/member/orders/project")
@Slf4j
public class OrdersController extends BaseController {

    @Autowired
    private INursingProjectService iNursingProjectService;


    @GetMapping("/page")
    public TableDataInfo list(NursingProject nursingProject){
        startPage();
        List<NursingProject> list = iNursingProjectService.selectNursingProjectList(nursingProject);
        return getDataTable(list);
    }

    @GetMapping("/{id}")
    public AjaxResult getById(@PathVariable Long id){
        NursingProject result = iNursingProjectService.getById(id);
        return success(result);
    }
}
